package com.its.util.rabbitConfig;

import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * rabbit信息转换配置
 * 开启之后即可支持对象传递
 */
@Configuration
public class MessageTransformConfig { // 命名规范：首字母小写，驼峰命名
    /**
     * 消息转换器配置
     * @return
     */
    @Bean
    public MessageConverter jsonMessageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
